require.config({
    shim:{
        'bootstrap':{
            deps:['jquery'],
            exports:'bootstrap'
        }
    },
    paths:{
        "jquery":"../lib/jquery/dist/jquery.min",
        "bootstrap":"../lib/bootstrap/dist/js/bootstrap.min",
        "vue":"../lib/vue/dist/vue.min",
        "index":"index"
    }
});

require(['jquery','bootstrap','index','vue'],function($,bootstrap,index,Vue){
    console.log("require loaded...");
    console.log('vue=>'+Vue);
    let boot = new Boot(Vue);
    boot.init();
});

function Boot(Vue){
    this.date='20180624';
    this.init = ()=>{
        new Vue({
            el:'#mycart',
            data:{
                name:'hanley',
                age:18,
                myitem:'',
                arr:['a','b','c','d'],
                carts:[{item:'Apple',qty:1,payflg:0},
                {item:'Huawei',qty:2,payflg:1},
                {item:'Mi8',qty:5,payflg:0},
                {item:'OPPO',qty:1,payflg:1}]
            },
            methods:{
                add:function(itemName){
                    this.carts.unshift({item:itemName,qty:1,payflg:0});
                },
                del:function(index){
                    this.carts.splice(index,1);
                }
            }
        });
    }
}

